<template>
  <div class="flex justify-start">
    <div class="item-panel padding-sm radius bg-orange light margin-lr-sm cursor" :class="itemStep.isActive ? 'active text-white text-blod' : ''">
      <div>
        <!-- <div class="status-icon-box">
          <div class="item-icon"><span class="vxe-icon-square-checked-fill"></span></div>
        </div> -->
        <div class="center-box" @click="itemClick">
          <div class="item-top">
            <div class="item-title text-cut">
              <span class="text-shadow">{{ `${itemStep.nodeDictName}` }}</span>
            </div>
          </div>
          <div class="item-center text-shadow">
            <!-- <span class="text-xs">2024.01.01</span>
            <span>~</span>
            <span class="text-xs">2024.02.01</span> -->
            <span class="text-bold">{{itemStep.pageCode=='RptResultBac'? itemStep.addFeeDesc:'-' }}</span>
          </div>
          <div class="item-bottom">
            <span class="solids-bottom line-black"></span>
          </div>
        </div>
        <!-- <div class="right-box" @click="addItemClick">
          <div class="status-icon-box">
            <div class="item-icon"><span class="vxe-icon-square-plus-fill"></span></div>
          </div>
        </div> -->
      </div>
    </div>
    <div class="padding-sm radius arrow-font" v-if="isShowNexrArrow">
      <el-icon>
        <Right />
      </el-icon>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, computed, reactive, getCurrentInstance } from 'vue';
//import FlowStepCompItem from './FlowStepItemComp.vue';
defineExpose({
  getAddFeeCnt
});
let { proxy }: any = getCurrentInstance();
const props = defineProps({
  itemStep: {} as any,
  isShowNexrArrow: { type: Boolean, default: true }
});

/**节点选中 */
const itemClick = () => {
  proxy.$emit('itemClick', props.itemStep);
};
/**在此之后添加节点 */
const addItemClick = () => {
  proxy.$emit('addItemClick', props.itemStep);
};
function getAddFeeCnt(data) {
  if (data.bacDrugCnt > 0) {
    if (data.addFeeCnt > 0) {
      props.itemStep.addFeeDesc = '已补费';
      props.itemStep.addFee = 0;
    } else {
      props.itemStep.addFeeDesc = '未补费';
      props.itemStep.addFee = 1;
    }
  } else {
    props.itemStep.addFee = null;
    props.itemStep.addFeeDesc = '-';
  }
}
</script>

<style scoped lang="scss">
$primary-1: var(--primaryColor1);
$primary-2: var(--primaryColor2);
$backgroundColor: var(--backgroundColor);

$transition: all 500ms ease;

.item-panel {
  width: 120px !important;
  height: 30px;
  white-space: break-spaces;
  align-content: center;
  border-radius: 5px;
  text-align: center;
  vertical-align: middle;
}

.status-icon-box {
  display: flex;
  font-size: 1.5em !important;
  font-weight: 800 !important;
  align-items: center;
  justify-content: center;
  padding: 0px 10px;
}

.arrow-font {
  display: flex;
  font-size: 2em !important;
  font-weight: 800 !important;
  align-items: center;
  justify-content: center;
  color: #ff9900;
}

.cursor {
  cursor: pointer;
}

.icon-success {
  position: absolute;
  opacity: 0;
  transform: scale(0);
  width: 24px;
  transition: $transition;
}

.active {
  background-color: $background-color-green;
  color: white;
}
</style>
